package Model.DateProfile;

import java.sql.ResultSet;
import java.sql.Statement;
import DBAccess.DBAccess;

public class PreferenceInfo {

	private int userID;
	private int heightUpper;
	private int heightLower;
	private int weightUpper;
	private int weightLower;
	private int ageUpper;
	private int ageLower;
	private int gender;
	private String religion;
	private String ethnicity;

	public PreferenceInfo(int userID){
		this.userID = userID;
		Statement st = null;
		ResultSet rs = null;
		try{
			st = DBAccess.con.createStatement();
			rs = st.executeQuery("SELECT * from preferencedb WHERE userID="+userID);
			if(rs.next()){
				heightUpper = rs.getInt("heightUpper");
				heightLower = rs.getInt("heightLower");
				weightUpper = rs.getInt("weightUpper");
				weightLower = rs.getInt("weightLower");
				ageUpper = rs.getInt("ageUpper");
				ageLower = rs.getInt("ageLower");
				ethnicity = rs.getString("ethnicity");
				religion = rs.getString("religion");
				gender = rs.getInt("gender");
			}
		} catch (Exception e){
			e.printStackTrace();
		}
		DBAccess.close(st,rs);
	}
	
public int getUserID() {
	return userID;
}

public void setUserID(int userID) {
	this.userID = userID;
}

public int getHeightUpper() {
	return heightUpper;
}

public void setHeightUpper(int heightUpper) {
	this.heightUpper = heightUpper;
}

public int getHeightLower() {
	return heightLower;
}

public void setHeightLower(int heightLower) {
	this.heightLower = heightLower;
}

public int getWeightUpper() {
	return weightUpper;
}

public void setWeightUpper(int weightUpper) {
	this.weightUpper = weightUpper;
}

public int getWeightLower() {
	return weightLower;
}

public void setWeightLower(int weightLower) {
	this.weightLower = weightLower;
}

public void setAgeUpper(int ageUpper) {
	this.ageUpper = ageUpper;
}

public int getAgeUpper(){
	return ageUpper;
}

public void setAgeLower(int ageLower) {
	this.ageLower = ageLower;
}

public int getAgeLower(){
	return ageLower;
}

public void setGender(int gender) {
	this.gender = gender;
}

public int getGender(){
	return gender;
}

public String getReligion() {
	return religion;
}

public void setReligion(String religion) {
	this.religion = religion;
}
public String getEthnicity() {
	return ethnicity;
}
public void setEthnicity(String ethnicity) {
	this.ethnicity = ethnicity;
}

}